package hy;

import com.ImportDefReg;
import com.MyCfg;
import com.MySelector;
import com.Stu;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Import;

@Import({Stu.class, MyCfg.class, MySelector.class, ImportDefReg.class})
@SpringBootConfiguration
@EnableAutoConfiguration
@ComponentScan
public class ImportApp {
    public static void main(String[] args) {
        ApplicationContext c=SpringApplication.run(ImportApp.class);
        System.out.println(c.getBean("com.Stu"));
        System.out.println("===================================");
        String[] arr = c.getBeanDefinitionNames();
        for (String s:arr){
            System.out.println(s);
        }
    }
}
